import request, {download} from "@/utils/request";



/*
* 重启计算服务 传入一个path
* */
export function reStartPP(param){
    return request({
        url: '/monitor/reStartPP.action',
        method: "get",
        params: param
    })
}

/*
* 计算服务日志
* */
export function downloadXppLog(){
    return request({
        url: '/monitor/downloadXppLog.action',
        method: "get"
    })
}
/*
* 获取可以的服务器
* */
export function getServiceMonitor(){
    return request({
        url: '/monitor/getServiceMonitor.action',
        method: "get"
    })
}

/*
* 获取计算服务器的历史负载信息
* */
export function queryCalcServerInfoByPage(data){
    return request({
        url: '/monitor/queryCalcServerInfoByPage.action',
        method: "post",
        data: data
    })
}

export function logEnvironment(data){
    return request({
        url: 'log/logEnvironment.action',
        method: "get",
        params: data
    })
}

export function downloadLog(data){
    // return request({
    //     url: 'log/downloadLog.action',
    //     method: "get",
    //     params: data
    // })
    download("log/downloadLog.action",data)
}
export function downloadLogByIp(data){
    // return request({
    //     url: 'log/downloadLogByIp.action',
    //     method: "post",
    //     params: data
    // })
    download("log/downloadLogByIp.action",data)
}

export function downloadLogAll(data){
    // return request({
    //     url: 'log/downloadLogAll.action',
    //     method: "get",
    //     params: data
    // })
    download("log/downloadLogAll.action",{})
}

export function logFileContentSearch(data){
    return request({
        url: 'log/logFileContentSearch.action',
        method: "get",
        params: data
    })
}
